package com.venutech.gongan.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.venutech.gongan.entity.User;
import com.venutech.gongan.model.ResultFormat;
import com.venutech.gongan.vo.UserDto;

import java.util.List;

public interface UserService {
   /**
     * 插入数据
     * @return
     */
   ResultFormat insert(User user);

    /**
     * 查询用户名是否存在
     * @param login_user_name
     * @return
     */
    User searchUserName(String login_user_name);

    /**
     * 用户登录
     * @param login_user_name
     * @param login_password
     * @return
     */
    User login(String login_user_name, String login_password);

    /**
     * 查询所有用户
     * @return
     */
    List<User> selectAll();

    //根据ID返回对象
    int deleteById(Integer user_id);

   //根据ID返回对象
   User getById(Integer user_id);

    //根据id修改信息
    int updateUser(User user);

    //分页查询
    Page<User> getInfo(Integer pageNo, Integer pageSize, String begintime, String endtime,
                       String badw, String login_user_name);

    //分页查询
    Page<User> getInfoEmpno(Integer pageNo, Integer pageSize, String employee_no);

    UserDto getUserById(int userId);

    UserDto getUserByEmployeeNo(String employeeNo);

    User findUserByEmployeeNo(String employeeNo);

    List<Integer> getUserRoles(Integer userId);

    List<String> getUserButtonPrivilegeList(Integer userId, String privilegeCode);

    List<String> getUserMenuPrivilegeList(Integer userId);

    boolean checkAdmin(Integer userId);

    List<Integer> getUserAllRoleIds(Integer userId);

    int updateUserPassword(int userId, String newPassword);

    UserDto assembleUserDto(User user);

}
